﻿<UserControl x:Class="LatestChatty.Controls.StoryListControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="#FFFFFF"
    d:DesignHeight="480" d:DesignWidth="480">
    
    <Grid x:Name="LayoutRoot">
        <ListBox x:Name="MainListBox" ItemsSource="{Binding Stories}" SelectionChanged="MainListBox_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Margin="0,0,0,20" Width="460">
                        <TextBlock HorizontalAlignment="Left" Text="{Binding name}" FontSize="24" Foreground="#ffba00"/>
                        <!--<TextBlock Text="{Binding date}" FontSize="20" Foreground="#888888"/>-->
                        
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="70"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="{Binding preview}" TextWrapping="Wrap" Foreground="White" Height="110"/>
                            <Grid Grid.Column="1">
                                <Image Margin="-3,0,0,-7" Source="/Images/Comments.png" Stretch="Uniform" Height="70" Width="70"/>
                                <Grid Margin="10,10,10,10">
                                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding comment_count}" FontSize="20" Foreground="#ffffff" FontWeight="Bold"/>
                                    <HyperlinkButton Click="Button_Click"/>
                                </Grid>
                            </Grid>
                        </Grid>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
